<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    const getJson = function (url) {
    const promise = new Promise((resolve, reject) => {
        const handler = function () {
            if(this.readyState !== 4) {
                return;
            }
            if(this.status === 200) {
                resolve(this.response);
            }else {
                reject(new Error(this.statusText));
            }
        };
        const client = new XMLHttpRequest();
        client.open('GET', url);
        client.onreadystatechange = handler;
        client.responseType = 'json';
        client.setRequestHeader('Accept', 'application/json');
        client.send();
    });
    return promise;
};

getJson('http://118.25.136.154/data/xsqk/?startTime=2018-01-01&endTime=2018-02-01&ztlxs=美团').then(function (json) {
    console.log(json);
}, function (err) {
    console.log(err)
})
</script>
</body>
</html>